import requests,json,urllib3,time,hashlib
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


def down(url):
        cid = '508'
        i = '{"pageIndex":5,"pageSize":10}'
        o = '19DDD1FBDFF065D3A4DA777D2D7A81EC'
        timestamp = str(int(time.time()*1000))
        sign = "cid=" + cid + "&param=" + i + o + timestamp
        hex = hashlib.md5()
        hex.update(sign.encode('utf-8'))
        sign = hex.hexdigest()
        print(sign)
        print(timestamp)
        headers = {
                # "authority": "hao.yiche.com",
                "x-platform": "pc",
                "x-sign": sign,
                "x-timestamp": timestamp,
                # "x-user-guid": "a9f123e80087cd4aec7983ad6d611113"
        }
        jsons = {"cid":"508","param":{"pageIndex":5,"pageSize":10}}
        res = requests.post(url=url,headers=headers,verify=False,json=jsons)
        return res


if __name__ == '__main__':
        url = 'https://hao.yiche.com/site_web/hao/api/get_latest_video_list'

        res = down(url).text
        print(res)